package com.yuerenjf.yuerenjinfu.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.yuerenjf.yuerenjinfu.R;
import com.yuerenjf.yuerenjinfu.bean.FindTabBean;

import java.util.List;

/**
 * Created by Administrator on 2017/6/13 0013.
 */

public class AdapterFindReport extends BaseAdapter{
    Activity mActivity;
    private List<FindTabBean.MediaCoveragesBean> beanList;
    public AdapterFindReport(Activity mActivity, List<FindTabBean.MediaCoveragesBean> beanList){
        this.mActivity=mActivity;
        this.beanList=beanList;
    }

    @Override
    public int getCount() {
        return beanList.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        View convertView=null;ViewHolder viewHolder;
        if(convertView==null){
           viewHolder=new ViewHolder();
            convertView= LayoutInflater.from(mActivity).inflate(R.layout.item_find_report,null);
            viewHolder.textView= (TextView) convertView.findViewById(R.id.item_find_report_text);
            convertView.setTag(viewHolder);
        }else{
            viewHolder= (ViewHolder) convertView.getTag();
        }

        FindTabBean.MediaCoveragesBean bean=beanList.get(i);
        viewHolder.textView.setText(bean.getName());

        return convertView;
    }

    class ViewHolder{
        TextView textView;

        public ViewHolder() {
        }

    }
}
